<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('client/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>

          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['name']->renderLabel() ?></th>
        <td>
          <?php echo $form['name']->renderError() ?>
          <?php echo $form['name'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ref1']->renderLabel() ?></th>
        <td>
          <?php echo $form['ref1']->renderError() ?>
          <?php echo $form['ref1'] ?>
        </td>
        <td class="formHelp">
            <?php echo $form['ref1']->renderHelp()?>
            <?php echo link_to('New Contact','contact/new',array('popup'=>array('window','width=900,height=800,left=300,top=50,location=no,scrollbars =yes,resizable=yes,directories=no,status=no,toolbar=no,menub ar=no')))?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ref2']->renderLabel() ?></th>
        <td>
          <?php echo $form['ref2']->renderError() ?>
          <?php echo $form['ref2'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ref3']->renderLabel() ?></th>
        <td>
          <?php echo $form['ref3']->renderError() ?>
          <?php echo $form['ref3'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['note']->renderLabel() ?></th>
        <td>
          <?php echo $form['note']->renderError() ?>
          <?php echo $form['note'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['address']->renderLabel() ?></th>
        <td>
          <?php echo $form['address']->renderError() ?>
          <?php echo $form['address'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
